/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 高生平
 * Date: 2025-09-06
 * Time: 19:03
 */
public class Test {
    public static int sumN (int n) {
        if (n == 1) {
            return 1;
        }
        return n + sumN(n - 1);
    }
    public static void main(String[] args) {
        System.out.println("1+2+3+...+10 = " + sumN(10));
    }
}
